package org.lanqiao.tjut.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.lanqiao.tjut.bean.TBAdminsBean;
import org.lanqiao.tjut.db.DBFactory;

public class UserLoginModel {
	public List<TBAdminsBean> getUserLoginInfo(TBAdminsBean adminB){
		//组织数据查询操作sql语句
		String strSql="select * from tbadmins where admins_name=? and admins_psw=?";
		//查询语句的sql参数
		List<Object> lstParas=new ArrayList<>();
		//添加参数
		lstParas.add(adminB.getAdmins_name());
		lstParas.add(adminB.getAdmins_psw());
		//调用db层执行sql语句
		List<TBAdminsBean> lstAdmins=DBFactory.getDBDriverInstance().query(strSql, new BeanListHandler<>(TBAdminsBean.class), lstParas.toArray());
		//返回登录查询结果信息集
		return lstAdmins;
	}

}
